# -*- coding:utf8 -*-
# __author__ = "zhangying"
# __date__ = "2019/2/19 11:33"

#business层-业务层-操作-操作层handle

from handle.login_handle import LoginhHandle


class LoginBusiness:
    def __init__(self,i):
        self.login_handle = LoginhHandle(i)

    #登陆成功
    def login_pass(self):
        self.login_handle.send_username('13524559846')
        self.login_handle.send_password('qiao2012')
        self.login_handle.click_login()
    #登陆成功第二个账号-于浩的

    def login_pass02(self):
        self.login_handle.send_username('18838175067')
        self.login_handle.send_password('woaini520...')
        self.login_handle.click_login()

    #登陆失败-账号错误
    def login_user_error(self):
        self.login_handle.send_username('13524559847')
        self.login_handle.send_password('qiao2012')
        self.login_handle.click_login()
        user_flag = self.login_handle.get_fail_tost('账号未注册')
        if user_flag:
            return True
        else:
            return False

    #登陆失败-登陆密码错误
    def login_password_error(self):
        self.login_handle.send_username('13524559846')
        self.login_handle.send_password('qiao2013')
        self.login_handle.click_login()
        user_flag = self.login_handle.get_fail_tost('登陆密码错误')
        if user_flag:
            return True
        else:
            return False
